package com.cloud.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cloud.mapper.SeckillGoodsMapper;
import com.cloud.pojo.SeckillGoods;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

@DubboService
@Transactional
public class SeckillGoodsServiceImpl implements SeckillGoodsService {
  @Autowired
  private SeckillGoodsMapper seckillGoodsMapper;


  @Override
  public void add(SeckillGoods seckillGoods) {
    seckillGoodsMapper.insert(seckillGoods);
   }


  @Override
  public void update(SeckillGoods seckillGoods) {
    seckillGoodsMapper.updateById(seckillGoods);
   }


  @Override
  public Page<SeckillGoods> findPage(int page, int size) {
    return seckillGoodsMapper.selectPage(new Page(page, size), null);
   }
}
